__author__ = 'FutureAdmin'
"""
    大多数解释已经在程序的注释中了.你需要记住的只是如果你想要复制一个列表或者类似的序列或者其他复杂的对象.那么你必须使用切片操作符来取得拷贝,如果你只是想使用另一个变量名,两个名称都reference同一个对象,那么如果你不小心的话,可能会引来各种麻烦.

    记住列表的赋值语句不创建拷贝.你得使用切片操作符来建立序列的拷贝.
"""


print("Simple Assignment")

shoplist = ["apple", "mango", "carrot", "banana"]
mylist = shoplist

del shoplist[0]

print("shoplist is " , shoplist)
print("mylist is" , mylist)

print("Copy by making a full slice")

mylist = shoplist[:]
del mylist[0]
print("shoplist is " , shoplist)
print("mylist is" , mylist)